export const drawer_config = () => {
    const config = {
        show: false,
        title: "新增",
        direction: "rtl",
        size: "30%",
        labelWidth: "90px",
        messageBox: {
            status: true,
            title: "提示",
            message: "是否保存当前数据？",
            confirmButtonText: '保存',
            cancelButtonText: '放弃',
            type: 'warning', // success
            confirmEventName: "save",
            cancelEventName: null
        },
        ifSave: true,
        form: [
            {
                key: "id",
                type: "hidden",
            },
            {key: "name", type: "text", label: "证件名称", alert: ""},
            {key: "type", type: "radio", label: "证件类型", alert: "", dict: "card_type",source: "dict",},
            {label: '所属人员', key: 'nameBy',type: "text"},
            {label: '证件人', key: 'documentName',type: "text"},
            {label: '证件号', key: 'documentNum',type: "text"},
            {key: "status", type: "radio", label: "状态", alert: "", dict: "status_type",source: "dict",},
            // {label: '存入时间', key: 'createTime',type: "text"},
            {label: '最后解除时间', key: 'outTime',type: "date"},
        ],
        //https://github.com/yiminghe/async-validator
        rules: {
            name: [
                {required: true, message: '请输入证件名称', trigger: 'blur'},
            ],
            type: [
                {required: true, message: '请选择证件类型', trigger: 'blur'},
            ],
            status: [
                {required: true, message: '请选择状态', trigger: 'blur'},
            ],
            nameBy: [
                {required: true, message: '请输入所属人员', trigger: 'blur'},
            ],
            outTime: [
                {required: true, message: '请选择最后解除时间', trigger: 'blur'},
            ],
            documentName: [
                {required: true, message: '请输入证件人', trigger: 'blur'},
            ],
            documentNum: [
                {required: true, message: '请输入证件号', trigger: 'blur'},
            ]
        }
    }
    return config
}